//
//  Constant.swift
//  WeiBo
//
//  Created by apple on 16/6/23.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

/// 输出日志

/// - parameter message:  日志消息

/// - parameter logError: 错误标记，默认是 false，如果是 true，发布时仍然会输出

/// - parameter file:     文件名

/// - parameter method:   方法名

/// - parameter line:     代码行数

func printLog<T>(message: T,
    logError: Bool = false,
    file: String = __FILE__,
    method: String = __FUNCTION__,
    line: Int = __LINE__)
{
    if logError {
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
    } else {
        #if DEBUG
            print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
        #endif
    }
}


//MARK:-- 授权认证的一些信息
//let AppKey = "1284491449"
//let AppSecret = "4c696ee3a04b7fb31abe719707a14ee5"
//let AppRedirectURL = "http://www.itheima.com"
// https://api.weibo.com/oauth2/authorize?client_id=1284491449&redirect_uri=http://www.itheima.com

let AppKey = "612414931"
let AppSecret = "0b8f332053579cc33470daa74405d9fa"
let AppRedirectURL = "http://www.itcast.cn"

//MARK:-- 通知
let kNotificationChangeRootViewController = "changeViewController"
let kNoitficationTransformEmoticon = "kNoitficationTransformEmoticon"
let kNotificationDeleteEmotiocn = "kNotificationDeleteEmotiocn"
let kNotificationPhotoBrower =  "kNotificationPhotoBrower"


//MARK:--颜色
/// RGB颜色
func RGB(r r: CGFloat, g: CGFloat, b: CGFloat) -> UIColor {
    return UIColor(red: r / 255, green: g / 255, blue: b / 255, alpha: 1)
}

/// 随机颜色
func RandomColor() -> UIColor {
    return RGB(r: CGFloat(random()) % 255, g: CGFloat(random()) % 255, b: CGFloat(random()) % 255)
}

//MARK:--
/// 屏幕宽高
let kUIScreenWidth = UIScreen.mainScreen().bounds.size.width
let KUIScreenHeight = UIScreen.mainScreen().bounds.size.height
let kUIScreenSize = UIScreen.mainScreen().bounds.size
let kUIScreenBounds = UIScreen.mainScreen().bounds


